package day06;

import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class CalTotalAvg {
    static Scanner sc = new Scanner(System.in);
    static Random  rand=new Random();
    public static void main(String[] args) {
        double [] point = Point();
        double avg=avg(point);
        System.out.println("平均分"+avg+"分");

    }
    public  static double[] Point(){
        System.out.println("一共有多少个评委？");
        int i = sc.nextInt();
        double[] point = new double[i];
        point=getPoint(i);
        return point;

    }
    public  static double[] getPoint(int i){
        double[] point = new double[i];
        for (i=0;i<point.length;i++){
            System.out.println("第"+(i+1)+"位评委的评分为");
            point[i]= sc.nextDouble();
        }
        return point;

    }
    public static double  avg(double[] point){
        Arrays.sort(point);
        double avg1=0 ;
        for (int i=1;i<point.length-1;i++) {
            System.out.println(" "+point[i]);
            avg1 += point[i];
        }
        avg1/=point.length-2;
        return avg1;
    }

}
